﻿#include "FITKSEAJunctionLine.h"

namespace Acoustics
{
    FITKSEAJunctionLine::FITKSEAJunctionLine()
    {

    }

    FITKSEAJunctionLine::~FITKSEAJunctionLine()
    {

    }

    FITKAbstractJunction::JunctionType FITKSEAJunctionLine::getJunctiontType()
    {
        return FITKAbstractJunction::JunctionType::SEALineJunction;
    }

    void FITKSEAJunctionLine::appendConnection(FITKSEAJunLineConStr & connection)
    {
        _connections.append(connection);
    }

    void FITKSEAJunctionLine::replaceConnections(QList<FITKSEAJunLineConStr>& connections)
    {
        _connections = connections;
    }

    QList<FITKSEAJunLineConStr> FITKSEAJunctionLine::getConnections()
    {
        return _connections;
    }

    void FITKSEAJunctionLine::appendPoint(int pointID)
    {
        _pointsID.append(pointID);
    }

    QList<int> FITKSEAJunctionLine::getPoints()
    {
        return _pointsID;
    }

    void FITKSEAJunctionLine::replectPoints(QList<int>& nodes)
    {
        _pointsID = nodes;
    }

    void FITKSEAJunctionLine::setLineLength(double length)
    {
        _length = length;
    }

    double FITKSEAJunctionLine::getLineLength()
    {
        return _length;
    }

    void FITKSEAJunctionLine::updateConnect()
    {
        _connections.clear();
        for (int subSysID : _subSysIDList) {
            FITKSEAJunLineConStr str;
            str._subSysID = subSysID;
            _connections.append(str);
        }

        this->FITKSEAAbstractJunction::initUserDefineMatrix(_subSysIDList);
    }
}